﻿CREATE PROCEDURE [dbo].[AddCategoryRoleAccess]
	@CategoryRoleAccessId uniqueidentifier,
	@Category uniqueidentifier,
	@SecurityRole uniqueidentifier,
    @Permissions int,
	@CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO CategoryRoleAccess

	(CategoryRoleAccessId, Category, SecurityRole, [Permissions], CreatedBy, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@CategoryRoleAccessId, @Category, @SecurityRole, @Permissions, @CreatedBy, @CreatedOn, @LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM CategoryRoleAccess WHERE CategoryRoleAccessId = @CategoryRoleAccessId

RETURN 0